Skip to content

Conversation

benalleng
Copy link

The quote macro requires some special syntax for string interpolation that this PR adds.

spacebear21 and others added 21 commits June 12, 2025 16:56
Just upgrade the version and break things
It was removed in uniffi 0.29 per
mozilla/uniffi-rs#2387.
Type alias the custom type to the builtin type.

Co-authored-by: Johnosezele <johnosezele@gmail.com>
There is an outstanding TODO in primitives.rs to "implement
BytesCodeType" and some other TODOs in the associated macro, those
probably need to be addressed.
Write distinct namespaces to their respective files. Implement imports
rendering to auto-import modules for external types.
Implement the missing methods necessary to traverse the FFI layer for
uniffi Objects, which under the hood are just pointers to an address in
memory.
The BytesCodeType macro block is moved to the top because Rust macros
match patterns in the order they are defined. More specific macros need
to come before general ones.
Previously unnamed tuple variants would generate fields with the empty
string as a name, as in:

class V2ReceiverException extends ReceiverException {
    final SessionError ;
    V2ReceiverException(this.,);
    V2ReceiverException._(this.,);
    // ...
}

This fix follows the approach from
https://github.com/mozilla/uniffi-rs/blob/1d412109db2b29c44b80231a8438014236935127/uniffi_bindgen/src/bindings/kotlin/templates/macros.kt#L136
with a helper function that uses tuple indices when the field.name() is
empty.

The helper functions replace "Error" with "Exception" to abide by
DartCodeOracle::class_name.

The constructor parameters now also use static typing.

Co-authored-by: benalleng <benalleng@gmail.com>
This adds support for Foreign Trait objects.
When $inner_cl_converter_name.read returns a non-nullable inner type, it
needs to be explicitly type-annotated to a nullable type for the
Optional wrapper return value.
RustBuffer is defined independently in each file, which causes type
mismatches when using a RustBuffer type from a different namespace.

To fix this, each external namespace is now imported twice: once without
an alias and a second time with a library prefix. This allows us to
handle prefix external `RustBuffer`s with the corresponding library
name, without having to prefix every other external type.
Solves the persistent issue where callback interface implementations
require manual initialize() calls even when extending/implementing
abstract classes.
Linux is more restrictive with dynamic library loading and doesn't
search the current path when only a filename is provided.
Callers may need to construct Record types to use e.g. as argument to a
relevant function.
reduce() doesn't work on empty sequences, but fold() does.
The quote macro requires some special syntax for string interpolation
that this PR adds.
@spacebear21 spacebear21 force-pushed the upgrading-to-0.29 branch 6 times, most recently from c8b2fe6 to 4edd627 Compare July 11, 2025 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants